<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">


<!-- remove old header -->


<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>cogen API Reference Documentation
        - Class: Socket</title><meta name="MSSmartTagsPreventParsing" content="true" /><meta http-equiv="imagetoolbar" content="no" /><link href="css/default.css" rel="stylesheet" type="text/css" /><link href="css/pygments.css" rel="stylesheet" type="text/css" />
    <!-- <link rel="shortcut icon" href="/images/favicon.ico" type="image/vnd.microsoft.icon"/> -->
    <link rel="stylesheet" href="css/apydia.css" type="text/css" />
    <script src="js/jquery-1.2.1.pack.js" type="text/javascript"></script>
    <script src="js/apydia.js" type="text/javascript"></script>
	<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
</head>
<body>
    <div id="page">
        <div id="browser">
            <div class="browser-section">
                <h2>Module Index</h2>
                <ul>
                    <li>
                        <a href="cogen.html">cogen</a>
                    </li><li>
                        <a href="cogen.common.html">cogen.common</a>
                    </li><li>
                        <a href="cogen.core.html">cogen.core</a>
                    </li><li>
                        <a href="cogen.web.html">cogen.web</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Methods</h2>
                <ul>
                    <li>
                        <a href="cogen.core.sockets.Socket.html#method-accept">accept</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-bind">bind</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-close">close</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-connect">connect</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-connect_ex">connect_ex</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-dup">dup</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-fileno">fileno</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-getpeername">getpeername</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-getsockname">getsockname</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-getsockopt">getsockopt</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-gettimeout">gettimeout</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-listen">listen</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-makefile">makefile</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-sendall">sendall</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-setblocking">setblocking</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-setsockopt">setsockopt</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-settimeout">settimeout</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#method-shutdown">shutdown</a>
                    </li>
                </ul>
            </div>
            <div class="browser-section">
                <h2>Attributes</h2>
                <ul>
                    <li>
                        <a href="cogen.core.sockets.Socket.html#attribute-"></a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-"></a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-"></a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-recv">recv</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-recv_into">recv_into</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-recvfrom">recvfrom</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-recvfrom_into">recvfrom_into</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-send">send</a>
                    </li><li>
                        <a href="cogen.core.sockets.Socket.html#attribute-sendto">sendto</a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content">
    <h1>Class: cogen.core.sockets.Socket</h1>
    <div class="docstring rst"></div>
    <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen\cogen\core\sockets.py#L25">View source</a>
    </li>
</ul>
    <div>
        <h2>Methods</h2>
            <h3 id="method-accept">
                accept
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>accept() -&gt; (socket object, address info)</p>
<p>Wait for an incoming connection.  Return a new socket representing the
connection, and the address of the client.  For IP sockets, the address
info is a pair (hostaddr, port).</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogenocket.py#L165">View source</a>
    </li>
</ul>
            <h3 id="method-bind">
                bind
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>bind(address)</p>
<p>Bind the socket to a local address.  For IP sockets, the address is a
pair (host, port); the host must refer to the local host. For raw packet
sockets the address is a tuple (ifname, proto [,pkttype [,hatype]])</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-close">
                close
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>close()</p>
<p>Close the socket.  It cannot be used after this call.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogenocket.py#L158">View source</a>
    </li>
</ul>
            <h3 id="method-connect">
                connect
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>connect(address)</p>
<p>Connect the socket to a remote address.  For IP sockets, the address
is a pair (host, port).</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-connect_ex">
                connect_ex
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>connect_ex(address) -&gt; errno</p>
<p>This is like connect(address), but returns an error code (the errno value)
instead of raising an exception when an error occurs.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-dup">
                dup
                <span class="args">(self)</span>
            </h3>
            <div class="docstring rst"><p>dup() -&gt; socket object</p>
<p>Return a new socket object connected to the same system resource.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogenocket.py#L170">View source</a>
    </li>
</ul>
            <h3 id="method-fileno">
                fileno
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>fileno() -&gt; integer</p>
<p>Return the integer file descriptor of the socket.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-getpeername">
                getpeername
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>getpeername() -&gt; address info</p>
<p>Return the address of the remote endpoint.  For IP sockets, the address
info is a pair (hostaddr, port).</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-getsockname">
                getsockname
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>getsockname() -&gt; address info</p>
<p>Return the address of the local endpoint.  For IP sockets, the address
info is a pair (hostaddr, port).</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-getsockopt">
                getsockopt
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>getsockopt(level, option[, buffersize]) -&gt; value</p>
<p>Get a socket option.  See the Unix manual for level and option.
If a nonzero buffersize argument is given, the return value is a
string of that length; otherwise it is an integer.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-gettimeout">
                gettimeout
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>gettimeout() -&gt; timeout</p>
<p>Returns the timeout in floating seconds associated with socket
operations. A timeout of None indicates that timeouts on socket
operations are disabled.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-listen">
                listen
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>listen(backlog)</p>
<p>Enable a server to accept connections.  The backlog argument must be at
least 1; it specifies the number of unaccepted connection that the system
will allow before refusing new connections.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-makefile">
                makefile
                <span class="args">(self, mode='r', bufsize=-1)</span>
            </h3>
            <div class="docstring rst"><p>makefile([mode[, bufsize]]) -&gt; file object</p>
<p>Return a regular file object corresponding to the socket.  The mode
and bufsize arguments are as for the built-in open() function.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogenocket.py#L176">View source</a>
    </li>
</ul>
            <h3 id="method-sendall">
                sendall
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>sendall(data[, flags])</p>
<p>Send a data string to the socket.  For the optional flags
argument, see the Unix manual.  This calls send() repeatedly
until all data is sent.  If an error occurs, it's impossible
to tell how much data has been sent.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-setblocking">
                setblocking
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>setblocking(flag)</p>
<p>Set the socket to blocking (flag is true) or non-blocking (false).
setblocking(True) is equivalent to settimeout(None);
setblocking(False) is equivalent to settimeout(0.0).</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-setsockopt">
                setsockopt
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>setsockopt(level, option, value)</p>
<p>Set a socket option.  See the Unix manual for level and option.
The value argument can either be an integer or a string.</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-settimeout">
                settimeout
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>settimeout(timeout)</p>
<p>Set a timeout on socket operations.  'timeout' can be a float,
giving in seconds, or None.  Setting a timeout of None disables
the timeout feature and is equivalent to setblocking(1).
Setting a timeout of zero is the same as setblocking(0).</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="method-shutdown">
                shutdown
                <span class="args">(self, *args)</span>
            </h3>
            <div class="docstring rst"><p>shutdown(flag)</p>
<p>Shut down the reading side of the socket (flag == SHUT_RD), the writing side
of the socket (flag == SHUT_WR), or both ends (flag == SHUT_RDWR).</p>
</div>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
    </div>
    <div>
        <h2>Attributes</h2>
            <h3 id="attribute-"></h3>
            <div class="docstring rst"></div>
            <h4>Value of </h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-"></h3>
            <div class="docstring rst"></div>
            <h4>Value of </h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-"></h3>
            <div class="docstring rst"></div>
            <h4>Value of </h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-recv">recv</h3>
            <div class="docstring rst"></div>
            <h4>Value of recv</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-recv_into">recv_into</h3>
            <div class="docstring rst"></div>
            <h4>Value of recv_into</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-recvfrom">recvfrom</h3>
            <div class="docstring rst"></div>
            <h4>Value of recvfrom</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-recvfrom_into">recvfrom_into</h3>
            <div class="docstring rst"></div>
            <h4>Value of recvfrom_into</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-send">send</h3>
            <div class="docstring rst"></div>
            <h4>Value of send</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
            <h3 id="attribute-sendto">sendto</h3>
            <div class="docstring rst"></div>
            <h4>Value of sendto</h4>
            <pre class="code"><code>None</code></pre>
            <ul class="link-bar">
    <li class="top"><a href="#header">Top</a></li>
    <li class="link-to-sourcecode">
        <a href="http://cogen.googlecode.com/svn/trunk/cogen#L0">View source</a>
    </li>
</ul>
    </div>
        </div>
        <div id="footer">
            Generated with <a href="http://apydia.ematia.de/" class="extern">
            Apydia 0.0.2</a>
        </div>
    </div>
</body>
</html>